#! /bin/bash
#zk.sh start/stop/status
#1、判断参数是否传入
if [ $# -lt 1 ]
then
	echo "必须传入start/stop/status..."
	exit
fi
#2、根据参数启动/停止/查看状态
case $1 in
"start")
	for host in hadoop102 hadoop103 hadoop104
	do
		echo "==========$host=========="
		ssh $host "/opt/module/zookeeper/bin/zkServer.sh start"
	done
;;
"stop")
	for host in hadoop102 hadoop103 hadoop104
	do
		echo "==========$host=========="
		ssh $host "/opt/module/zookeeper/bin/zkServer.sh stop"
	done
;;
"status")
	for host in hadoop102 hadoop103 hadoop104
	do
		echo "==========$host=========="
		ssh $host "/opt/module/zookeeper/bin/zkServer.sh status"
	done
;;
*)
	echo "参数输入错误..."
;;
esac